home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / CURSOS2.H < prev    next >
Text File  |  1993-01-18  |  7KB  |  287 lines

  1. /* $Header: c:/curses/RCS/cursos2.h%v 2.0 1992/11/16 22:40:44 MH Rel $ */
  2. #ifndef CURSOS2_INCL
  3. #define CURSOS2_INCL 1
  4.  
  5. #ifdef CURSES__32BIT__
  6.  
  7. #define KbdSetStatus Kbd32SetStatus
  8. #define KbdGetStatus Kbd32GetStatus
  9. #define KbdCharIn Kbd32CharIn
  10. #define KbdPeek   Kbd32Peek
  11. #define KbdFlushBuffer Kbd32FlushBuffer
  12.  
  13. #define VioGetMode Vio32GetMode
  14. #define VioSetMode Vio32SetMode
  15. #define VioGetCurPos Vio32GetCurPos
  16. #define VioSetCurPos Vio32SetCurPos
  17. #define VioGetCurType Vio32GetCurType
  18. #define VioSetCurType Vio32SetCurType
  19. #define VioScrollDn Vio32ScrollDn
  20. #define VioScrollUp Vio32ScrollUp
  21. #define VioGetConfig Vio32GetConfig
  22. #define VioWrtTTY Vio32WrtTTY
  23. #define VioReadCellStr Vio32ReadCellStr
  24. #define VioWrtCellStr Vio32WrtCellStr
  25. #define VioWrtNAttr Vio32WrtNAttr
  26.  
  27. #define FARKeyword
  28.  
  29. #define CURS_INCL_VIO_KBD
  30.  
  31.  
  32. #ifdef __EMX__
  33. #  ifndef USE_OS2_H
  34. #     define USE_OS2_H
  35. #  endif
  36. #  define APIENTRY
  37. #else
  38. #  define APIRET ULONG
  39. #endif
  40.  
  41. #else
  42.  
  43.  
  44. #   define FARKeyword far
  45. #   define APIRET USHORT
  46.  
  47. #ifdef USE_OS2_H
  48. #   define INCL_VIO
  49. #   define INCL_KBD
  50. #else
  51. #   define CURS_INCL_VIO_KBD
  52. #endif
  53.  
  54.  
  55. #endif   /* __32BIT__ */
  56.  
  57.  
  58. /* if USE_OS2_H is defined then use the os2.h that comes with your compiler ...*/
  59.  
  60. #ifdef USE_OS2_H
  61. #  include <os2.h>
  62. #else
  63.  
  64. /* ... otherwise use these definitions */
  65.  
  66. #  include <os2def.h>
  67.  
  68. #endif
  69.  
  70. #ifdef CURS_INCL_VIO_KBD
  71.  
  72. typedef SHANDLE         HKBD;
  73. typedef HKBD    FARKeyword *   PHKBD;
  74.  
  75.  
  76. typedef SHANDLE         HVIO;
  77. typedef HVIO    FARKeyword *   PHVIO;
  78.  
  79.  
  80.  
  81. typedef struct _KBDINFO {
  82.         USHORT cb;
  83.         USHORT fsMask;
  84.         USHORT chTurnAround;
  85.         USHORT fsInterim;
  86.         USHORT fsState;
  87.         }KBDINFO;
  88. typedef KBDINFO FARKeyword *PKBDINFO;
  89.  
  90.  
  91. USHORT APIENTRY KbdSetStatus(
  92.         PKBDINFO    pkbdinfo,
  93.         HKBD        hkbd );
  94.  
  95.  
  96. USHORT APIENTRY KbdGetStatus(
  97.         PKBDINFO    pkbdinfo,
  98.         HKBD        hdbd  );
  99.  
  100.  
  101. typedef struct _KBDKEYINFO {
  102.         UCHAR    chChar;    /* ASCII character code                     */
  103.         UCHAR    chScan;    /* Scan Code                                */
  104.         UCHAR    fbStatus;
  105.         UCHAR    bNlsShift;
  106.         USHORT   fsState;
  107.         ULONG    time;
  108.         }KBDKEYINFO;
  109. typedef KBDKEYINFO FARKeyword *PKBDKEYINFO;
  110.  
  111. #define IO_WAIT     0
  112. #define IO_NOWAIT   1
  113.  
  114. USHORT APIENTRY KbdCharIn(
  115.         PKBDKEYINFO pkbci,
  116.         USHORT      fWait,      /* IO_WAIT, IO_NOWAIT     */
  117.         HKBD        hkbd);
  118.  
  119. USHORT APIENTRY KbdFlushBuffer(
  120.         HKBD hkbd);
  121.  
  122.  
  123. typedef struct _VIOMODEINFO {
  124.         USHORT cb;
  125.         UCHAR  fbType;
  126.         UCHAR  color;
  127.         USHORT col;     /* number of text columns                       */
  128.         USHORT row;     /* number of text rows                          */
  129.         USHORT hres;    /* horizontal resolution                        */
  130.         USHORT vres;    /* vertical resolution                          */
  131.         UCHAR  fmt_ID;
  132.         UCHAR  attrib;  /* number of attributes                         */
  133.         ULONG  buf_addr;
  134.         ULONG  buf_length;
  135.         ULONG  full_length;
  136.         ULONG  partial_length;
  137.         PCH    ext_data_addr;
  138.         } VIOMODEINFO;
  139. typedef VIOMODEINFO FARKeyword *PVIOMODEINFO;
  140.  
  141.  
  142. USHORT APIENTRY VioGetMode(
  143.         PVIOMODEINFO  pvioModeInfo,
  144.         HVIO          hvio);
  145.  
  146.  
  147. USHORT APIENTRY VioSetMode(
  148.         PVIOMODEINFO  pvioModeInfo,
  149.         HVIO          hvio);
  150.  
  151.  
  152. USHORT APIENTRY VioGetCurPos(
  153.         PUSHORT    pusRow,
  154.         PUSHORT    pusColumn,
  155.         HVIO       hvio );
  156.  
  157.  
  158. USHORT APIENTRY VioSetCurPos(
  159.         USHORT  usRow,
  160.         USHORT  usColumn,
  161.         HVIO    hvio);
  162.  
  163. typedef struct _VIOCURSORINFO {
  164.         USHORT   yStart;
  165.         USHORT   cEnd;
  166.         USHORT   cx;
  167.         USHORT   attr;   /* -1=hidden cursor, any other=normal cursor   */
  168.         } VIOCURSORINFO;
  169. typedef VIOCURSORINFO FARKeyword *PVIOCURSORINFO;
  170.  
  171.  
  172. USHORT APIENTRY VioGetCurType(
  173.        PVIOCURSORINFO pvioCursorInfo,
  174.        HVIO           hvio );
  175.  
  176.  
  177. USHORT APIENTRY VioSetCurType(
  178.         PVIOCURSORINFO pvioCursorInfo,
  179.         HVIO           hvio );
  180.  
  181. USHORT APIENTRY VioScrollDn(
  182.         USHORT  usTopRow,
  183.         USHORT  usLeftCol,
  184.         USHORT  usBotRow,
  185.         USHORT  usRightCol,
  186.         USHORT  cbLines,
  187.         PBYTE   pCell,
  188.         HVIO    hvio );
  189.  
  190.  
  191.  
  192. USHORT APIENTRY VioScrollUp(
  193.         USHORT  usTopRow,
  194.         USHORT  usLeftCol,
  195.         USHORT  usBotRow,
  196.         USHORT  usRightCol,
  197.         USHORT  cbLines,
  198.         PBYTE   pCell,
  199.         HVIO    hvio );
  200.  
  201.  
  202.    /* VIOCONFIGINFO.adapter constants */
  203.  
  204.    #define DISPLAY_MONOCHROME      0x0000
  205.    #define DISPLAY_CGA             0x0001
  206.    #define DISPLAY_EGA             0x0002
  207.    #define DISPLAY_VGA             0x0003
  208.    #define DISPLAY_8514A           0x0007
  209.  
  210.    /* VIOCONFIGINFO.display constants */
  211.  
  212.    #define MONITOR_MONOCHROME      0x0000
  213.    #define MONITOR_COLOR           0x0001
  214.    #define MONITOR_ENHANCED        0x0002
  215.    #define MONITOR_8503            0x0003
  216.    #define MONITOR_851X_COLOR      0x0004
  217.    #define MONITOR_8514            0x0009
  218.  
  219. typedef struct _VIOCONFIGINFO {
  220.         USHORT  cb;
  221.         USHORT  adapter;
  222.         USHORT  display;
  223.         ULONG   cbMemory;
  224.         USHORT  Configuration;
  225.         USHORT  VDHVersion;
  226.         USHORT  Flags;
  227.         ULONG   HWBufferSize;
  228.         ULONG   FullSaveSize;
  229.         ULONG   PartSaveSize;
  230.         USHORT  EMAdaptersOFF;
  231.         USHORT  EMDisplaysOFF;
  232.         } VIOCONFIGINFO;
  233. typedef VIOCONFIGINFO FARKeyword *PVIOCONFIGINFO;
  234.  
  235.  
  236. USHORT APIENTRY VioGetConfig(
  237.         USHORT         usConfigId,  /* Reserved (must be 0)             */
  238.         PVIOCONFIGINFO pvioin,
  239.         HVIO           hvio );
  240.  
  241. USHORT APIENTRY VioWrtTTY(
  242.         PCH     pch,
  243.         USHORT  cb,
  244.         HVIO    hvio );
  245.  
  246. USHORT APIENTRY VioReadCellStr(
  247.         PCH       pchCellStr,
  248.         PUSHORT   pcb,
  249.         USHORT    usRow,
  250.         USHORT    usColumn,
  251.         HVIO      hvio );
  252.  
  253. USHORT APIENTRY VioWrtCellStr(
  254.         PCH      pchCellStr,
  255.         USHORT   cb,
  256.         USHORT   usRow,
  257.         USHORT   usColumn,
  258.         HVIO     hvio );
  259.  
  260. USHORT APIENTRY VioWrtNAttr(
  261.         PBYTE     pAttr,
  262.         USHORT    cb,
  263.         USHORT    usRow,
  264.         USHORT    usColumn,
  265.         HVIO      hvio );
  266.  
  267.  
  268. USHORT APIENTRY VioWrtNCell(
  269.         PBYTE   pCell,
  270.         USHORT  cb,
  271.         USHORT  usRow,
  272.         USHORT  usColumn,
  273.         HVIO    hvio );
  274.  
  275. #endif
  276.  
  277. #endif
  278.  
  279.  
  280. #ifndef KEYBOARD_ASCII_MODE
  281. #define KEYBOARD_ASCII_MODE 0x0008
  282. #endif
  283.  
  284. #ifndef KEYBOARD_BINARY_MODE
  285. #define KEYBOARD_BINARY_MODE 0x0004
  286. #endif
  287.